﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class CheckOut : System.Web.UI.Page
{
    //private int currentState = -1;
    private static int counter = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        
        HtmlTableRow row1 = new HtmlTableRow();
        

    //    if (Request.QueryString["state"] != null)
    //    {
    //        currentState = Int32.Parse(Request.QueryString["state"]);
    //    }

    //    if (currentState == 1)
    //    {
    //        if (Request.QueryString["user"] == "old") treatOldUser();
    //        else treatNewUser();
    //    }
    //    else
    //    {
    //        checkUser();
    //    }
    }

    //private void treatNewUser()
    //{
    //    Response.Write("Hello there, wana join us?");
    //}

    //private void treatOldUser()
    //{
    //    Response.Write("Nice to see you again.");
    //}

    //private void checkUser()
    //{
    //    String temp = "";
    //    temp += "<h3>Are you new here ?</h3>";
    //    temp += "<button onClick=but_click('state=1&user=old')>Old user</button>";
    //    temp += "<button onClick=but_click('state=1&user=new')>New user</button>";

    //    checkoutDiv_inside.InnerHtml = temp;

        
    //}


    protected void butTest1_Click(object sender, EventArgs e)
    {
        counter++;
        HtmlTableRow row1 = new HtmlTableRow();

        HtmlTableCell cell1_2 = new HtmlTableCell();
        Label lb2 = new Label();
        lb2.Text = counter.ToString();
        cell1_2.Controls.Add(lb2);
        row1.Controls.Add(cell1_2);

        HtmlTableCell cell1_1 = new HtmlTableCell();
        Button bt1 = new Button();
        bt1.OnClientClick = "alertCus();";
        cell1_1.Controls.Add(bt1);
        row1.Controls.Add(cell1_1);
        mainCheckOutTable.Controls.Add(row1);

        mainCheckOutTable.Controls.Add(row1);

        LoadEffect();
        upGrid.Update();
        
    }


    private void LoadEffect()
    {
        string script = "loadEffect();";
        ScriptManager.RegisterClientScriptBlock(this, typeof(Page), UniqueID, script, true);
    }

    private void AlertJS()
    {
        string script = "alertCus();";
        ScriptManager.RegisterClientScriptBlock(this, typeof(Page), UniqueID, script, true);
    }
}